function [cropped_mask, cropped_image] = cropper(image, fg_bwlabel, bd_xy)
    %% cut out a bounding box matrix that we care about
    % get the dimensions and x, y starting position of our box
    coords = min(bd_xy);
    start_x = coords(1); start_y = coords(2); clear coords;
    dim = max(bd_xy) - min(bd_xy);
    width = dim(1); height = dim(2); clear dim;
    % crop from fg_bwlabel
    crop = uint8(fg_bwlabel(start_x:start_x+width, start_y:start_y+height));
    % edit crop so only the relevant integer n appears
    [r, c, v] = find(crop);
    m = mode(v); % mode of nonzero entries
    for x = 1:width+1
        for y = 1:height+1
            if crop(x, y) == m
                crop(x, y) = 1;
            else
                crop(x,y) = 0;
            end
        end
    end;
    cropped_mask = crop;
    cropped_image = cat(3, image(start_x:start_x+width, start_y:start_y+height, 1), image(start_x:start_x+width, start_y:start_y+height, 2), image(start_x:start_x+width, start_y:start_y+height, 3));
return;